<template>
  <el-form-item class="edit-item edit-item-switch switch-normal" :label="label">
    <el-switch
      v-model="modelValue"
      active-color="#127BFF"
      inactive-color="#D5DCE6" @change="onChange">
    </el-switch>
  </el-form-item>
</template>

<script>
  export default {
    emits: ['change','update:modelValue'],
    props: {
      label: [String, Number],
      modelValue: Boolean,
    },
    methods: {
      onChange(val) {
        this.$emit('update:modelValue', val);
        this.$emit('change');
      },
    }
  }
</script>
